package com.common.android.utils.httpRequest;

import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.message.BasicHeader;

import android.content.Context;

public class UapHttpRequest extends HttpRequest {

	private static class SingletonHolder {
		private static final UapHttpRequest INSTANCE = new UapHttpRequest();
	}
	private UapHttpRequest() {
		super(null);
	}
	
	public static final UapHttpRequest getInstance(Context context) {
		mContext=context;
		return SingletonHolder.INSTANCE;
	}
	
	private long uid;
//	private String sessionId;

    public void setUid(long uid) {
		this.uid = uid;
	}
    
//    public void setSessionId(String sessionId) {
//		this.sessionId = sessionId;
//	}
    
	@Override
	public void setHttpHeader(HttpRequestBase request) {
        super.setHttpHeader(request);
        //根据微博中描述，需啊要在头部增加下列参数。
        if(uid>0){
        	 request.addHeader(new BasicHeader("PHPUID", String.valueOf(uid)));
        }
//        if(!TextUtils.isEmpty(sessionId))
//        {
//        	 request.addHeader(new BasicHeader("PHPSESSION", String.valueOf(sessionId)));
//        }
    }
}
